package com.example.demo.controller;
import com.example.demo.mapper.StoreMapper;
import com.example.demo.utils.*;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;
import java.util.stream.Collectors;
import org.springframework.web.bind.annotation.RestController;

@RestController

public class StoreController {
    @Autowired
    private StoreMapper storeMapper;

    @GetMapping("/stores")
    public List<StoreNameIdDTO> getAllStoreNames(){
        List<StoreNameIdDTO> stores = storeMapper.selectAllStoreIdsAndNames();
        return stores;
    }

}
